/**
 *
 */
package anysware.json;

import net.sf.json.JSONObject;
import net.sf.json.JsonConfig;
import net.sf.json.processors.JsonBeanProcessor;

/**
 * TODO: doc me
 *
 * @author keke<keke@codehaus.org>
 * @revision $Revision: 111 $
 * @version
 */
public class ToStringBeanProcessor implements JsonBeanProcessor {

	/*
	 * (non-Javadoc)
	 *
	 * @see net.sf.json.processors.JsonBeanProcessor#processBean(java.lang.Object,
	 *      net.sf.json.JsonConfig)
	 */
	public JSONObject processBean(final Object arg0, final JsonConfig arg1) {
		final JSONObject obj = new JSONObject();
		obj.put("$", arg0.toString());
		obj.put("type", arg0.getClass().getName());
		return obj;
	}

}
